home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 42
/
Amiga Format AFCD42 (Issue 126, Aug 1999).iso
/
-serious-
/
programming
/
other
/
ioblixdevkit
/
c
/
include
/
resources
/
ioblix.h
Wrap
C/C++ Source or Header
|
1999-05-14
|
14KB
|
262 lines
/*
** $VER: resources/ioblix.h 37.3 (7.4.99)
**
** (C) Copyright 1998,1999 Thore Böckelmann
** All Rights Reserved.
*/
#ifndef RESOURCES_IOBLIX_H
#define RESOURCES_IOBLIX_H 1
#ifndef EXEC_TYPES_H
#include <exec/types.h>
#endif
#ifndef EXEC_NODES_H
#include <exec/nodes.h>
#endif
#ifndef EXEC_LISTS_H
#include <exec/lists.h>
#endif
#ifndef EXEC_LIBRARIES_H
#include <exec/libraries.h>
#endif
#ifndef EXEC_SEMAPHORES_H
#include <exec/semaphores.h>
#endif
#ifndef EXEC_INTERRUPTS_H
#include <exec/interrupts.h>
#endif
#ifndef PREFS_SERIAL_H
#include <prefs/serial.h>
#endif
#define IOBLIXRESNAME "ioblix.resource"
/* manufacturer and product IDs for RBM products */
#define RBM_MANUF_ID 4711 /* manufacturer ID of RBM Digitaltechnik */
#define IOBLIX_Z2_PROD_ID 1 /* board ID of ZorroII IOBlix board */
#define IOBLIX_1200_SER_PROD_ID 2 /* board ID of IOBlix1200 ser module */
#define IOBLIX_1200_PAR_PROD_ID 3 /* board ID of IOBlix1200 par module */
/* how many boards can exist */
#define IOBLIX_MAX_Z2_BOARDS 5
#define IOBLIX_MAX_CP_BOARDS 1
/* how many units of which type can exist */
#define IOBLIX_Z2_NUM_SERUNITS 4 /* max. serial ports on Z2 board */
#define IOBLIX_Z2_NUM_PARUNITS 2 /* max. parallel ports on Z2 board */
#define IOBLIX_Z2_NUM_FIFOUNITS 1 /* max. ext. fifos on Z2 board */
#define IOBLIX_Z2_NUM_ETHERUNITS 1 /* max. EtherNet modules on Z2 board */
#define IOBLIX_Z2_NUM_AUDIOUNITS 1 /* max. Audio modules on Z2 board */
#define IOBLIX_CP_NUM_SERUNITS 4 /* max. ser ports on clock port board */
#define IOBLIX_CP_NUM_PARUNITS 4 /* max. par ports on clock port board */
#define IOBLIX_CP_NUM_FIFOUNITS 0 /* max. fifos on clock port board */
#define IOBLIX_CP_NUM_ETHERUNITS 0 /* max. EtherNets on clock port board */
#define IOBLIX_CP_NUM_AUDIOUNITS 0 /* max. Audio modules on clock port board */
/* the central resource */
struct IOBlixResource {
struct Library ir_Library;
struct ExecBase *ir_SysBase;
/* private data follows, hands off! */
};
struct IOBlixBoardNode {
struct Node ibn_Node; /* link */
struct ConfigDev *ibn_Board; /* ConigDev structure as returned by */
/* expansion/FindConfigDev() */
UWORD ibn_Type; /* Z2, clock port, etc */
UWORD ibn_Number; /* internal board number */
};
/* IOBlixBoardNode.ibn_Type */
#define IBT_ZORRO2 1 /* ZorroII board */
#define IBT_CP_SERIAL 2 /* clock port serial module */
#define IBT_CP_PARALLEL 3 /* clock port parallel module */
/* common structure for chip's register addresses */
struct ChipRegs {
ULONG cr_RegCount; /* number of register addresses following */
APTR cr_Regs[1]; /* dummy array of register addresses */
/* cr_RegCount pointers follow */
};
struct IOBlixPnPInfo {
UBYTE pnp_SerialIdentifier[32]; /* serial identifiert read during PnP */
UBYTE pnp_DeviceIdent[8];
ULONG pnp_DeviceSerNo;
APTR pnp_AddressAddr; /* address register address */
APTR pnp_WriteAddr; /* write register address */
APTR pnp_ReadAddr; /* read register address */
ULONG pnp_CardSelectNumber; /* PnP device number (CSN) */
ULONG pnp_LogicalDeviceNumber; /* logical device number of this chip */
APTR pnp_Reserved[4];
};
/* IOBlixChipNode, returned by FindChip() and ObtainChip */
/* all fields are READ-ONLY! */
struct IOBlixChipNode {
struct Node icn_Node; /* link */
ULONG icn_Flags; /* flags */
UWORD icn_Type; /* chip type (ser, par, etc) */
UWORD icn_Number; /* chip's internal number */
/* equals unit number of devices */
struct ChipRegs *icn_ChipRegisters; /* array of pointers to chips registers */
/* ie a pointer to (struct UARTRegisters *) */
/* the old icn_Address entry is obsolete */
UBYTE icn_Description[256]; /* name, information, etc */
UBYTE *icn_Owner; /* current owner name, or NULL if none */
struct IOBlixBoardNode *icn_Board; /* board to which the chip belongs to */
LONG icn_ExpanderPort; /* cp port, if used with cp expander */
/* -1 for Z2 boards */
/* 0..3 for clockport modules */
struct SignalSemaphore icn_SharedAccessSema;
/* semaphore for shared chip access */
/* you MUST obtain this if you want to */
/* access the chip in shared mode to avoid */
/* crashes */
struct List icn_SharedAccessorList; /* list of shared accessors */
ULONG icn_SharedAccessorCount; /* counter for shared accesses */
union {
struct SerialChipProperties {
ULONG scp_UARTType; /* serial UART type */
ULONG scp_FIFOSize; /* UART's fifo size */
ULONG scp_Flags; /* flags */
ULONG scp_Frequency; /* oscillator frequency */
struct SerialPrefs scp_Prefs; /* baud, handshake, etc */
} icn_SerialProperties;
struct ParallelChipProperties {
ULONG pcp_Abilities; /* parport ability mask */
ULONG pcp_FIFOSize; /* parallel fifo size */
ULONG pcp_WriteThresh; /* irq threshold on write */
ULONG pcp_ReadThresh; /* irq threshold on read */
} icn_ParallelProperties;
struct ExternalFIFOProperties {
BOOL efp_Installed;
BOOL efp_Operable;
ULONG efp_WriteFIFOSize;
ULONG efp_WriteHalfFullSize;
ULONG efp_ReadFIFOSize;
ULONG efp_ReadHalfFullSize;
} icn_ExternalFIFOProperties;
struct AudioChipProperties {
struct IOBlixPnPInfo acp_PnPInfo;
} icn_AudioChipProperties;
} icn_Properties;
};
#define icns_UARTType icn_Properties.icn_SerialProperties.scp_UARTType
#define icns_FIFOSize icn_Properties.icn_SerialProperties.scp_FIFOSize
#define icns_Flags icn_Properties.icn_SerialProperties.scp_Flags
#define icns_Frequency icn_Properties.icn_SerialProperties.scp_Frequency
#define icns_Prefs icn_Properties.icn_SerialProperties.scp_Prefs
#define icnp_Abilities icn_Properties.icn_ParallelProperties.pcp_Abilities
#define icnp_FIFOSize icn_Properties.icn_ParallelProperties.pcp_FIFOSize
#define icnp_WriteThresh icn_Properties.icn_ParallelProperties.pcp_WriteThresh
#define icnp_ReadThr